<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <script type="text/javascript">
     	var colors = ['red', 'blue', 'green',{name:'a'}];
        console.log(colors.toString()); //red,blue,green
        console.log("colors", colors.valueOf()); //[red,bule,green]
        var res=colors.toString();
		var resJoin1=colors.join(',')
        var resJoin2=colors.join('||') 
        console.log(resJoin1) //red,blue,green
        console.log(resJoin2) //red||blue||green

  </script>
</body>

</html>